package gui;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

import logik.PerformTransactions;

public class AccMenu extends JPanel {

	/**
	 * Represents all variables
	 */
	private JLabel lbl_Header;
	private JButton btn_AccountInfo;
	private JButton btn_Deposit;
	private JButton btn_Withdrawal;
	private JButton btn_InterestRate;
	private JButton btn_Logout;
	private JButton btn_Back;
	private JLabel lbl_Intro;

	public AccMenu() {

		setPreferredSize(new Dimension(550, 400));
		setLayout(null);

		lbl_Header = new JLabel("Account Menu");
		lbl_Header.setFont(new Font("SansSerif", Font.BOLD, 26));
		lbl_Header.setBounds(175, 29, 180, 21);
		add(lbl_Header);

		btn_AccountInfo = new JButton("Account Info");
		btn_AccountInfo.setActionCommand("" + PerformTransactions.BALANCE_INQUIRY);
		btn_AccountInfo.setFont(new Font("SansSerif", Font.PLAIN, 16));
		btn_AccountInfo.setBounds(57, 139, 150, 40);
		add(btn_AccountInfo);

		btn_Deposit = new JButton("Deposit");
		btn_Deposit.setActionCommand("" + PerformTransactions.DEPOSIT);
		btn_Deposit.setFont(new Font("SansSerif", Font.PLAIN, 16));
		btn_Deposit.setBounds(320, 139, 150, 40);
		add(btn_Deposit);

		btn_Withdrawal = new JButton("Withdraw");
		btn_Withdrawal.setActionCommand("" + PerformTransactions.WITHDRAWAL);
		btn_Withdrawal.setFont(new Font("SansSerif", Font.PLAIN, 16));
		btn_Withdrawal.setBounds(57, 195, 150, 40);
		add(btn_Withdrawal);

		btn_InterestRate = new JButton("Interest Rate");
		btn_InterestRate.setActionCommand("" + PerformTransactions.INTERESTRATE);
		btn_InterestRate.setFont(new Font("SansSerif", Font.PLAIN, 16));
		btn_InterestRate.setBounds(320, 195, 150, 40);
		add(btn_InterestRate);

		btn_Logout = new JButton("Logout");
		btn_Logout.setActionCommand("" + PerformTransactions.LOGOUT);
		btn_Logout.setFont(new Font("SansSerif", Font.PLAIN, 16));
		btn_Logout.setBounds(320, 300, 150, 40);
		add(btn_Logout);

		btn_Back = new JButton("Back");
		btn_Back.setActionCommand("" + PerformTransactions.BACK);
		btn_Back.setFont(new Font("SansSerif", Font.PLAIN, 16));
		btn_Back.setBounds(57, 300, 150, 40);
		add(btn_Back);

		lbl_Intro = new JLabel("Please choose one of the following options");
		lbl_Intro.setFont(new Font("SansSerif", Font.BOLD, 16));
		lbl_Intro.setBounds(57, 80, 328, 21);
		add(lbl_Intro);

	} // end AccMenu constructor
	
	public void addActionListener(ActionListener e){
		btn_Logout.addActionListener(e);
		btn_AccountInfo.addActionListener(e);
		btn_Deposit.addActionListener(e);
		btn_InterestRate.addActionListener(e);
		btn_Withdrawal.addActionListener(e);
		btn_Back.addActionListener(e);
	}
	
	public JButton getBtnLogout(){
		return btn_Logout;
	}
	
	public JButton getBtnBack(){
		return btn_Back;
	}
	
	public JButton getBtnAccountInfo(){
		return btn_AccountInfo;
	}
	
	public JButton getBtnDeposit(){
		return btn_Deposit;
	}
	
	public JButton getBtnInterestRate(){
		return btn_InterestRate;
	}
	
	public JButton getBtnWithdrawal(){
		return btn_Withdrawal;
	}
	

	
}